SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE [dbo].[DnnProduct_CDS_DistributorConfigAdd]
	@DistributorID varchar(50),
    @Name nvarchar(40),
    @Description nvarchar(2000),
    @DistURL varchar(254),
    @NotifyURL varchar(254),
    @SharedSecret varchar(50),
    @AllowedIPAddress varchar(254),
    @LocationDir varchar(50),
    @DownloadURLDir varchar(50),
    @DataPathDir varchar(50),
    @PWDBName varchar(50),
    @PWServerDN varchar(50),
    @MaxDownloadsReached nvarchar(4000),
    @UsePW bit,
    @AllowedWebStore varchar(254),
    @MaxLoanCount int,
    @LinkExpires int,
    @Deleted bit = 0,
    @DownloadExpired nvarchar(2000)
AS
BEGIN
	INSERT INTO [DISC_DistributorConfig]
           ([DistID],
			[Name],
			[DistURL],
			[NotifyURL],
			[SharedSecret],
			[AllowedIPAddress],
			[LocationDir],
			[DownloadURLDir],
			[DataPathDir],
			[PWDBName],
			[PWServerDN],
			[MaxDownloadsReached],
			[UsePW],
			[AllowedWebStore],
			[Description],
			[MaxLoanCount],
			[LinkExpires],
			[Deleted],
			[DownloadExpired])
     VALUES
           (@DistributorID,
			@Name,
			@DistURL,
			@NotifyURL,
			@SharedSecret,
			@AllowedIPAddress,
			@LocationDir,
			@DownloadURLDir,
			@DataPathDir,
			@PWDBName,
			@PWServerDN,
			@MaxDownloadsReached,
			@UsePW,
			@AllowedWebStore,
			@Description,
			@MaxLoanCount,
			@LinkExpires,
			@Deleted,
			@DownloadExpired)

	SELECT SCOPE_IDENTITY()
END
GO
